/**
 * title: 绑定邮箱
 */
import React, { Component } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import BindEmail from './components/BindEmail';
import EditBox from '../components/EditBox';
import Result from './components/Result';

class BindEmailWrapper extends Component {
  state = {
    success: false,
  };
  changeStatus = b => {
    this.setState({ success: b });
  };
  render() {
    const { success } = this.state;
    return (
      <PageHeaderWrapper
        title="绑定邮箱"
      >
      <EditBox
        title={success ? ' ' : '绑定邮箱'}
        description={
          success
            ? ' '
            : '请按照以下提示完成邮箱的绑定操作。请务必使用真实有效的邮箱地址，否则无法完成验证。'
        }
      >
        {success ? <Result /> : <BindEmail changeStatus={this.changeStatus} />}
      </EditBox>
      </PageHeaderWrapper>
    );
  }
}
export default BindEmailWrapper;
